#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @Time : 2021/3/30 22:19 
# @Author : wenzi
# @File : settings.py 
# @Software: PyCharm
import configparser
import os

basedir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))

config = configparser.ConfigParser()
config.read('config.ini')
db_type = config.get('db', 'type')
db_driver = config.get('db', 'driver')
username = config.get('db', 'username')
password = config.get('db', 'password')
host = config.get('db', 'host')
port = config.get('db', 'port')
db_name = config.get('db', 'db_name')

class DevelopConfig(object):
    SECRET_KEY = 'abcd123654'
    SQLALCHEMY_DATABASE_URI = f'{db_type}+{db_driver}://{username}:{password}@{host}:{port}/{db_name}'
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    DEBUG = True